# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: kevin <kevin@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>

pkgname=perl-libintl-perl
pkgver=1.28
pkgrel=1
pkgdesc="Perl Module: Localization support"
arch=('i686' 'x86_64')
license=('LGPL')
url="http://search.cpan.org/dist/libintl-perl"
depends=('coreutils' 'gettext' 'perl')
options=('!emptydirs')
source=("http://www.cpan.org/authors/id/G/GU/GUIDO/libintl-perl-$pkgver.tar.gz")
sha512sums=('50f0836c1a84a22fcc8fca0fff2faeaae66774ec67b96c09a911c4969e8a610bbf20ba38167c13339b9ad9617e1fca07cb0cb1f12732f973b1cf618d502f59aa')

build() {
  cd libintl-perl-$pkgver
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd libintl-perl-$pkgver
  make test
}

package() {
  cd libintl-perl-$pkgver
  PERL_USE_UNSAFE_INC=1 \
  make install DESTDIR="$pkgdir"
# template start; name=perl-binary-module-dependency; version=1;
if [[ $(find "$pkgdir/usr/lib/perl5/" -name "*.so") ]]; then
	_perlver_min=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]);')
	_perlver_max=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]+1);')
	depends+=("perl>=$_perlver_min" "perl<$_perlver_max")
fi
# template end;
}
